drawTex

fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int)

Extension function to replicate drawGuiTexture from 1.20.2-1.21.1. Uses the RenderLayer.getGuiTextured method to fill in the function param

Author

fzzyhmstrs

Since

0.2.0

Parameters

id

Identifier - The sprite identifier for the image.

x

Int - the x location of the texture

y

Int - the y location of the texture

width
  • the width of the texture

height
  • the height of the texture


fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int, color: Int)

Extension function to replicate drawGuiTexture from 1.20.2-1.21.1. Uses the RenderLayer.getGuiTextured method to fill in the function param

Author

fzzyhmstrs

Since

0.2.0

Parameters

id

Identifier - The sprite identifier for the image.

x

Int - the x location of the texture

y

Int - the y location of the texture

width
  • the width of the texture

height
  • the height of the texture

color
  • the color of the texture


fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int, alpha: Float)

Extension function to replicate drawGuiTexture from 1.20.2-1.21.1. Uses the RenderLayer.getGuiTextured method to fill in the function param

Author

fzzyhmstrs

Since

0.2.0

Parameters

id

Identifier - The sprite identifier for the image.

x

Int - the x location of the texture

y

Int - the y location of the texture

width
  • the width of the texture

height
  • the height of the texture

alpha
  • the texture transparency


fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, u: Float, v: Float, width: Int, height: Int, texWidth: Int, texHeight: Int)

Extension function to draw a texture, replacing drawtexture. Uses the RenderLayer.getGuiTextured method to fill in the function param

Author

fzzyhmstrs

Since

0.6.0

Parameters

id

Identifier - The sprite identifier for the image.

x

Int - the x location of the texture

y

Int - the y location of the texture

u

Float - the horizontal position of the texture region

v

Float - the vertical position of the texture region

width
  • the width of the drawn region in pixels

height
  • the height of the drawn region in pixels

texWidth
  • the width of the texture in pixels

texHeight
  • the height of the texture in pixels